import { Device } from "@/api/interface/iot";
import http from "@/api";
import { ResPage } from "../../interface";

/**
 * @name 告警管理模块
 */

// * 获取告警列表
export const getAlarmList = (params: any) => {
	return http.get<ResPage<Device.ResDataInfo[]>>(`/alarm/find`, params);
};
// 查询设备告警配置
export const getDeviceAlarmConfig = (params: any, noLoading?: boolean) => {
	return http.get(`/alarm/config/get`, params, { headers: { noLoading: noLoading } });
};
// 查询设备告警配置
export const getDeviceAlarmConfigList = (params: any) => {
	return http.get(`/alarm/config/find`, params);
};
// 删除设备告警配置
export const delDeviceAlarmConfig = (params: any) => {
	return http.post(`/alarm/config/remove`, params);
};
// * 添加设备告警配置
export const addDeviceAlarm = (params: any) => {
	return http.post(`/alarm/config/add`, params);
};
// * 编辑设备告警配置
export const modifyDeviceAlarm = (params: any) => {
	return http.post(`/alarm/config/modify`, params);
};
export const processAlarm = (params: any) => {
	return http.post(`/alarm/process`, params);
};
// * 告警排名
export const topAlarm = (params: any) => {
	return http.get(`/alarm/top`, params);
};
// * 告警趋势
export const trendAlarm = (params: any, noLoading?: boolean) => {
	return http.get(`/alarm/trend`, params, { headers: { noLoading: noLoading } });
};
// * 删除告警
export const delAlarm = (params: any) => {
	return http.post(`/alarm/remove`, params);
};
